/*
 * 四位反序数（4分）
 */

#include <stdio.h>

int main() {
	setbuf(stdout, NULL);

	int data = 1000, inverse = 0;


	while (data <= 9999) {
		int temp = data;

		while (temp > 0) {
			inverse *= 10;
			inverse += temp % 10;

			temp /= 10;
		}

		if (9 * inverse == data) {
			printf("%d\n", data);
		}

		inverse = 0;
		++data;
	}

	return 0;
}
